import java.util.*;
class Year {
	private static final String[] MONTH_NAMES  = {"january", "february",
		"march", "april", "may", "june", "july", "august", "september",
		"october", "november", "december"};
	private static final int[] MONTH_LENGTHS = {31, 28, 31, 30, 31, 30, 31, 31,
												30, 31, 30, 31};
	static int getMonthLength(String monthName, boolean isLeapYear) {
		int result;
		List<String> monthList = Arrays.asList(MONTH_NAMES);
		int index = monthList.indexOf(monthName);
		if (monthName == "february" && isLeapYear) {
			result = 29;
		} else {
			result = MONTH_LENGTHS[index];
		}
		return result;
	};
	
	static int getMonthLength(int monthNumber, boolean isLeapYear) {
		int result;
		if (monthNumber == 2 && isLeapYear) {
			result = 29;
		} else {
			result = MONTH_LENGTHS[monthNumber - 1];
		}
		return result;
	};
	
	static String getVerbalDate(int[] date) {
		String result;
		result = date[0] + " " + MONTH_NAMES[date[1] - 1] + " " +
			date[2];
		return result;
	}
	
	static int getMonthNumber(String monthName) {
		int result;
		List<String> monthList = Arrays.asList(MONTH_NAMES);
		result = monthList.indexOf(monthName) + 1;
		return result;
	}
}